package com.xm.xmapp;

import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.TextView;

import com.xm.xmapp.app.CodeConstant;
import com.xm.xmapp.base.BaseActivity;
import com.xm.xmapp.response.bean.Get_user_invoice_record_listResponse;
import com.xm.xmapp.response.bean.Get_user_invoice_record_listResponse.T;
import com.xm.xmapp.tools.StringTools;

public class InvoiceDetailsActivity extends BaseActivity implements OnClickListener {

	private Get_user_invoice_record_listResponse.T bean;
	private TextView title, name, address, fapiaotitle, money, time, qita;
	private ImageView back;

	@Override
	protected void onCreate(Bundle savedInstanceState) {

		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_invoicedetails);

	}

	@Override
	public void initView() {

		title = (TextView) findViewById(R.id.title);
		back = (ImageView) findViewById(R.id.back);

		name = (TextView) findViewById(R.id.name);
		address = (TextView) findViewById(R.id.address);
		fapiaotitle = (TextView) findViewById(R.id.fapiaotitle);
		money = (TextView) findViewById(R.id.money);
		time = (TextView) findViewById(R.id.time);
		qita = (TextView) findViewById(R.id.qita);

	}

	@Override
	public void initData() {

		bean = (T) getIntent().getSerializableExtra("bean");
		title.setText("发票详情");
		if (bean != null) {
			name.setText(bean.consignee_name + "  " + bean.consignee_phone);
			address.setText(bean.invoice_address);
			fapiaotitle.setText("公司抬头：" + bean.invoice_title);
			money.setText(bean.invoice_money);
			time.setText("申请时间：" + StringTools.getTime(bean.submit_time * 1000, "yyyy-MM-dd  HH-mm-ss"));
			qita.setText("详情咨询：" + CodeConstant.phone);
		}

	}

	@Override
	public void initEvent() {
		back.setOnClickListener(this);

	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.back:
			finish();
			break;

		default:
			break;
		}

	}

}
